package app.common.dao;
import java.util.ArrayList;
import java.util.List;

import cn.lily.com.container.data.Record;
import cn.lily.com.exception.YaconException;
import cn.lily.esb.framework.drivers.db.bean.ControlDAO;
public class Leo_tag_typeBean extends ControlDAO implements Cloneable {
	private static final long serialVersionUID = 1L;
	public Leo_tag_typeBean() throws YaconException {
		super();
		setTableName("LEO_TAG_TYPE");
	}
	String  ftag_typ_nam;
	String  ftag_typ_id;
	String  fcreate_time;
	String  fcreate_oper;

	public void setTag_typ_nam( String tag_typ_nam)throws YaconException{
		setFieldData("tag_typ_nam",tag_typ_nam,TEXT);
		this.ftag_typ_nam=tag_typ_nam;
	}

	public String getTag_typ_nam(){
		if ( this.ftag_typ_nam == null){
			return "";
		}
		else {
			return this.ftag_typ_nam;
		}
	}

	public void setTag_typ_id( String tag_typ_id)throws YaconException{
		setFieldData("tag_typ_id",tag_typ_id,TEXT);
		this.ftag_typ_id=tag_typ_id;
	}

	public String getTag_typ_id(){
		if ( this.ftag_typ_id == null){
			return "";
		}
		else {
			return this.ftag_typ_id;
		}
	}

	public void setCreate_time( String create_time)throws YaconException{
		setFieldData("create_time",create_time,DATE);
		this.fcreate_time=create_time;
	}

	public String getCreate_time(){
		if ( this.fcreate_time == null){
			return "";
		}
		else {
			return this.fcreate_time;
		}
	}

	public void setCreate_oper( String create_oper)throws YaconException{
		setFieldData("create_oper",create_oper,TEXT);
		this.fcreate_oper=create_oper;
	}

	public String getCreate_oper(){
		if ( this.fcreate_oper == null){
			return "";
		}
		else {
			return this.fcreate_oper;
		}
	}

	public  List<Leo_tag_typeBean> findListBeans(String sSqlWhere)throws YaconException {
		List<Leo_tag_typeBean> listBeans = new ArrayList<Leo_tag_typeBean>();
		findTable = findTableByWhere(sSqlWhere);
		while (findTable.next())
		{
			Leo_tag_typeBean fDaoBean  = new Leo_tag_typeBean();
			fDaoBean.ftag_typ_nam = findTable.getString("tag_typ_nam");
			fDaoBean.ftag_typ_id = findTable.getString("tag_typ_id");
			fDaoBean.fcreate_time = findTable.getString("create_time");
			fDaoBean.fcreate_oper = findTable.getString("create_oper");
			fDaoBean.operate_mode = "edit";
			listBeans.add(fDaoBean);
		}
		return listBeans;
	}

	public Leo_tag_typeBean findBean(String sSqlWhere)throws YaconException {
		findTable = findTableByWhere(sSqlWhere);
		if (findTable.next())
		{
			Leo_tag_typeBean fDaoBean  = new Leo_tag_typeBean();
			fDaoBean.ftag_typ_nam = findTable.getString("tag_typ_nam");
			fDaoBean.ftag_typ_id = findTable.getString("tag_typ_id");
			fDaoBean.fcreate_time = findTable.getString("create_time");
			fDaoBean.fcreate_oper = findTable.getString("create_oper");
			fDaoBean.operate_mode = "edit";
			return fDaoBean;
		}else
			return null;
	}

	public void setViewRecord(Record viewRecord) throws YaconException{
		if (viewRecord.getString("tag_typ_nam") != null)
			setTag_typ_nam(viewRecord.getString("tag_typ_nam"));
		if (viewRecord.getString("tag_typ_id") != null)
			setTag_typ_id(viewRecord.getString("tag_typ_id"));
		if (viewRecord.getString("create_time") != null)
			setCreate_time(viewRecord.getString("create_time"));
		if (viewRecord.getString("create_oper") != null)
			setCreate_oper(viewRecord.getString("create_oper"));
	}

}
